export default ($axios) => {
  return {
    //getData: () => $axios.get('/self-api/v1/categories'),
    // 有参数的情况
    //postData: (data) => $axios.post('/api/get_index_data', data),
    //getData: (params) => $axios.get('/api/get_index_data', { params }),

    //工具列表
    getTools: (params) => {
      return $axios.get('/self-api/v1/tools', { params })
    },
    //工具查看
    getToolDetail: (handle, params) => {
      return $axios.get(`/self-api/v1/tools/${handle}`, {
        params,
      })
    },
    //工具随机handle
    getToolRandom: (params) => {
      return $axios.get('/self-api/v1/tools/random', { params })
    },
    //属性列表
    getAttributes: (params) => {
      return $axios.get('/self-api/v1/attributes', { params })
    },
    //分类列表
    getCategories: (params) => {
      return $axios.get('/self-api/v1/categories', {
        params: {
          ...params,
          order_by: 'order',
          direction: 'desc',
        },
      })
    },
    //分类分组
    getCategoriesGroups: (params) => {
      return $axios.get('/self-api/v1/categories/groups', {
        params: {
          ...params,
          order_by: 'order',
          direction: 'desc',
        },
      })
    },
    //收藏夹
    getFavorites: (params) => {
      return $axios.get('/self-api/v1/favorites', { params })
    },
    postFavorites: (data) => {
      return $axios.post('/self-api/v1/favorites', data)
    },
    deleteFavorites: (data) => {
      return $axios.delete('/self-api/v1/favorites', { data })
    },
    //提交
    submitWebsite: (data) => {
      return $axios.post('/self-api/v1/submit', data)
    },
    //推广
    promoteWebsite: (data) => {
      return $axios.post('/self-api/v1/submit/promote', data)
    },
    //列表
    submitWebsiteList: (params) => {
      return $axios.get('/self-api/v1/submit', { params })
    },
    //下个可用时间
    nextAvailableSlot: (params) => {
      return $axios.get('/self-api/v1/submit/next-available-slot', { params })
    },
    //支付
    checkSession: (params) => {
      return $axios.get('/common-api/v1/stripe/check-session', { params })
    },
    login: (data) => $axios.post('/common-api/v1/login', data),
    signup: (data) => $axios.post('/common-api/v1/signup', data),
    //获取用户信息
    userinfo: (params) => {
      return $axios.get('/self-api/v1/user', { params })
    },
    //忘记密码
    forgotPassword: (data) =>
      $axios.post('/common-api/v1/forgot-password', data),
    //通过验证码重置密码
    resetPassword: (data) => $axios.post('/common-api/v1/reset-password', data),
    //注销登录
    logout: () => $axios.delete('/common-api/v1/logout'),
    //生成授权链接
    authGoogleAuthUrl: (data) =>
      $axios.post('/common-api/v1/auth-google/auth-url', data),
    //生成授权链接
    authGoogleLogin: (data) =>
      $axios.post('/common-api/v1/auth-google/login', data),
    //多语言
    getLanguagesMul: (params) => $axios.get('/self-api/v1/languages', params),

    //替代页
    getToolkitsAlternative: (params) => {
      return $axios.get('/self-api/v1/toolkits/alternative', {
        params,
      })
    },
    //替代页同类列表
    getSameAlternative: (params) => {
      return $axios.get('/self-api/v1/toolkits/same-alternative', { params })
    },
    //替代页同类列表
    getToolkitsVs: (params) => {
      return $axios.get('/self-api/v1/toolkits/vs', { params })
    },
    //分类榜单
    getTopCategory: () => {
      return $axios.get('/self-api/v1/top/category')
    },
    //分类榜单V1
    getTopCategoryV1: (params) => {
      return $axios.get('/self-api/v1/top/category-v1', { params })
    },
    //分类榜单-单独分类
    getTopCategoryTools: (params) => {
      return $axios.get('/self-api/v1/top/category-tools', { params })
    },
    //地区榜单
    getTopRegion: (params) => {
      return $axios.get('/self-api/v1/top/region', { params })
    },
    //地区榜单V1
    getTopRegionV1: (params) => {
      return $axios.get('/self-api/v1/top/region-v1', { params })
    },
    //月份榜单
    getTopMonth: (params) => {
      return $axios.get('/self-api/v1/top/month-top', { params })
    },
    //来源榜单
    getTopUserSource: (params) => {
      return $axios.get('/self-api/v1/top/user-source', { params })
    },
    //来源榜单V1
    getTopUserSourceV1: (params) => {
      return $axios.get('/self-api/v1/top/user-source-v1', { params })
    },
    //流量增长趋势的工具榜单
    getTopTrending: (params) => {
      return $axios.get('/self-api/v1/top/trending', { params })
    },

    //标签详情页
    getTag: (params) => {
      return $axios.get('/self-api/v1/toolkits/tag', { params })
    },

    //页面尾部博客
    getBlogData: (lang) => {
      return $axios.get(`/gobal/data/1672367195/${lang}`, {
        dealErrorSelf: true,
      })
    },

    //2.1首页接口
    getToolsSearchList: (params) => {
      return $axios.get('/self-api/v1/tools/search/list', { params })
    },

    //2.1首页接口
    searchCueList: (params) => {
      return $axios.get('/self-api/v1/tools/search/search-cue-list', { params })
    },

    //2.1首页月份接口
    getMonthList: (params) => {
      return $axios.get('/self-api/v1/tools/search/get-month-list', {
        params,
        dealErrorSelf: true,
      })
    },

    //2.1分类详情接口
    getCategoriesV1: (params) => {
      return $axios.get('/self-api/v1/categories/detail', { params })
    },

    //分类详情页- 广告版 -v1
    categoriesDetailV1: (params) => {
      return $axios.get('/self-api/v1/categories/detail-v1', { params })
    },

    // chatgpts接口
    chatgpts: (params) => {
      return $axios.get('/self-api/v1/chatgpts', { params })
    },

    // chatgpts详情接口
    chatgptsDetail: (id) => {
      return $axios.get(`/self-api/v1/chatgpts/${id}`)
    },
    // chatgpts收藏夹
    getFavoritesChatgpts: (params) => {
      return $axios.get('/self-api/v1/favorites-chatgpts', { params })
    },
    postFavoritesChatgpts: (data) => {
      return $axios.post('/self-api/v1/favorites-chatgpts', data)
    },
    deleteFavoritesChatgpts: (data) => {
      return $axios.delete('/self-api/v1/favorites-chatgpts', { data })
    },
    // chatgpts概况
    getCatgptsOverview: (params) => {
      return $axios.get('/self-api/v1/chatgpts/overview', { params })
    },
    //高收入排行榜
    getHighRevenue: (params) => {
      return $axios.get('/self-api/v1/top/high-revenue', { params })
    },
    // 点击统计
    postCa: (data) => {
      return $axios.post('/self-api/v1/ca', data, { dealErrorSelf: true })
    },
    // Reviews
    getReviews: (handle) => {
      return $axios.get(`/self-api/v1/tool-reviews/${handle}`)
    },
    // top ai tools
    getTopArticles: (params) => {
      return $axios.get('/self-api/v1/top-articles', { params })
    },
    getTopArticlesDetail: (handle) => {
      return $axios.get(`/self-api/v1/top-articles/${handle}`)
    },
    // 曝光统计
    postEa: (data) => {
      return $axios.post('/self-api/v1/ea', data, { dealErrorSelf: true })
    },
    // 搜索统计
    postSa: (data) => {
      return $axios.post('/self-api/v1/sa', data, { dealErrorSelf: true })
    },
    //广告套餐
    advertisePackages: (params) => {
      return $axios.get('/self-api/v1/advertise/packages', { params })
    },
    //广告提交下单
    submitAdvertise: (data) => {
      return $axios.post('/self-api/v1/advertise', data)
    },

    // 付费广告列表
    advertise: (params) => {
      return $axios.get('/self-api/v1/advertise', { params })
    },

    // 用户工具列表
    userTools: (params) => {
      return $axios.get('/self-api/v1/user/tools', { params })
    },

    // 账单列表
    invoices: (params) => {
      return $axios.get('/common-api/v1/invoices', { params })
    },

    // 账单列表
    advertiseList: (params) => {
      return $axios.get('/self-api/v1/advertise', { params })
    },
    //修改用户信息
    setUserinfo: (data) => {
      return $axios.put('/common-api/v1/user', data)
    },

    // 账单详情
    subscriptionInvoicesDetail: (order_sn) => {
      return $axios.get(`/common-api/v1/invoices/${order_sn}`)
    },

    // 首页完整接口
    searchLisV1: (params) => {
      return $axios.get('/self-api/v1/tools/search/list-v1', { params })
    },

    // 首页-最新ai/最多/最多人使用 - 广告版-v1
    listSearchV1: (params) => {
      return $axios.get('/self-api/v1/tools/search/list-search-v1', { params })
    },

    // 获取首页的右侧广告位
    searchGetAd: (params) => {
      return $axios.get('/self-api/v1/tools/search/get-ad', { params })
    },

    // banner广告位
    bigAdvertisementUser: (params) => {
      return $axios.get('/self-api/v1/tools/search/big-advertisement-user', {
        params,
      })
    },

    //更改状态
    advertiseStatus: (data, id) => {
      return $axios.put(`/self-api/v1/advertise/status/${id}`, data)
    },

    //提交GPT
    submitGpt: (data) => {
      return $axios.post('/self-api/v1/submit-gpt', data)
    },

    // Gpt订单列表
    gptOrderList: (params) => {
      return $axios.get('/self-api/v1/submit-gpt', { params })
    },

    //提交更新工具订单
    completionSubmit: (data) => {
      return $axios.post('/self-api/v1/completion/submit', data)
    },

    // 更新工具订单列表
    completionList: (params) => {
      return $axios.get('/self-api/v1/completion', { params })
    },

    //更新工具
    completionUpdateMsg: (data) => {
      return $axios.put('/self-api/v1/completion/update-msg', data)
    },

    //更新工具查看
    completionDetail: (handle, params) => {
      return $axios.get(`/self-api/v1/completion/${handle}`, {
        params,
      })
    },

    //更新工具查看
    completionToolDetail: (handle, params) => {
      return $axios.get(`/self-api/v1/completion/tool/${handle}`, {
        params,
      })
    },

    // 分类属性列表
    categoryAttribute: (params) => {
      return $axios.get('/self-api/v1/category-attribute', { params })
    },
    // 分类属性详情
    categoryAttributeDetail: (params) => {
      return $axios.get(`/self-api/v1/category-attribute/detail`, {
        params,
      })
    },

    // Discord列表接口
    getDiscord: (params) => {
      return $axios.get('/self-api/v1/discord', { params })
    },
    
    // Discord详情
    getDiscordDetail: (params) => {
      return $axios.get(`/self-api/v1/discord/detail`, {
        params,
      })
    },
  }
}
